package com.gitee.xmhzzz.docker.demo.service.controller;

import com.gitee.xmhzzz.docker.demo.service.dto.ResultRes;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpSession;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName DemoController
 * @Description
 * @Author wzq
 * @Date 2023/12/29 14:04
 * @Version 1.0
 */

@Slf4j
@RestController
@RequestMapping("/demo/test/gateway")
public class DemoController {

    @GetMapping("/yaml")
    public ResultRes<String> testYaml(HttpServletRequest request){
        HttpSession session = request.getSession();
        session.setAttribute("a","a");
        log.info("testGateway yaml");
        ResultRes<String> res = new ResultRes<>();
        res.setCode(100);
        res.setMsg("success");
        return res;
    }
    @GetMapping("/bean")
    public ResultRes<String> testBean(HttpServletRequest request){
        HttpSession session = request.getSession();
        session.setAttribute("b","b");
        log.info("testGateway bean");
        ResultRes<String> res = new ResultRes<>();
        res.setCode(100);
        res.setMsg("success");
        return res;
    }

}
